<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>jMonthCalendar Sample</title>

    <link rel="stylesheet" href="css/core.css" type="text/css" />
		
    <script src="js/jquery-1.3.min.js" type="text/javascript"></script>
    <script src="js/jMonthCalendar-1.0.1.js" type="text/javascript"></script>


    <script type="text/javascript">
        $().ready(function() {
			var options = {
				onMonthChanged: function(dateIn) {
					//this could be an Ajax call to the backend to get this months events
					var events = [ 	{ EventID: 1, "Date": new Date(2009, 1, 1), "Title": "10:00 pm - EventTitle1", URL: "http://www.pertnearsandstone.com/Events/1" },
									{ EventID: 2, "Date": new Date(2009, 1, 2), "Title": "9:30 pm - this is a much longer title", URL: "http://www.pertnearsandstone.com/Events/1" }
					];
					$.jMonthCalendar.ReplaceEventCollection(events);
					return true;
				}
			};
			
			var events = [ 	{ EventID: 1, "Date": new Date(2009, 0, 1), "Title": "10:00 pm - EventTitle1", URL: "http://www.pertnearsandstone.com/Events/1" },
							{ EventID: 2, "Date": new Date(2009, 0, 2), "Title": "9:30 pm - this is a much longer title", URL: "http://www.pertnearsandstone.com/Events/1" }
			];
			
			var newoptions = { };
			var newevents = [ ];
			$.jMonthCalendar.Initialize(newoptions, newevents);

			
			//$.jMonthCalendar.Initialize(options, events);
			
			
			
			
			var extraEvents = [	{ EventID: 1, "Date": new Date(2009, 0, 11), "Title": "10:00 pm - EventTitle1", URL: "http://www.pertnearsandstone.com/Events/1" },
								{ EventID: 2, "Date": new Date(2009, 0, 20), "Title": "9:30 pm - this is a much longer title", URL: "http://www.pertnearsandstone.com/Events/1" }
			];
			
			$("#Button").click(function() {					
				$.jMonthCalendar.AddEvents(extraEvents);
			});
        });
    </script>
</head>
<body>

	<div id="jMonthCalendar"></div>

	<button id="Button">Add More Events</button>

	<script type="text/javascript">
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
	<script type="text/javascript">
	try {
	var pageTracker = _gat._getTracker("UA-4755411-2");
	pageTracker._trackPageview();
	} catch(err) {}</script>

</body>
</html>